#!/usr/bin/env python
# -*- conding: utf-8 -*-

"""
@Time     : 2024/8/20 21:05
@Author   : liujingmao
@File     : 2.字符串提示拼接.py
"""

from langchain_core.prompts import PromptTemplate

promt = (
        PromptTemplate.from_template("请讲一个关于{subject}的冷笑话")
        + ",让我天心一下" +
        "\n使用{language}语言"
)
## 对比三种打印有什么区别？
print(promt)
print("________________+不加to_string")
print(promt.invoke({"subject": "中国足球", "language": "Python"}))
print("________________+加to_string()")
print(promt.invoke({"subject": "中国足球", "language": "Python"}).to_string())
print("________________+加to_messages()")
print(promt.invoke({"subject": "中国足球", "language": "Python"}).to_messages())
print("________________+加to_json()")
print(promt.invoke({"subject": "中国足球", "language": "Python"}).to_json())
